# Maintainer: wahibre <wahibre@gmx.com>

_realname=mtn
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=3.5.0
pkgrel=2
pkgdesc="Command line program to save thumbnails (screenshots) of movie or video files into jpeg/png files (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://gitlab.com/movie_thumbnailer/mtn"
license=('GPL2')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
             "${MINGW_PACKAGE_PREFIX}-make")
depends=("${MINGW_PACKAGE_PREFIX}-ffmpeg"
         "${MINGW_PACKAGE_PREFIX}-libgd")
source=("${url}/-/archive/v${pkgver}/${_realname}-v${pkgver}.tar.gz")
sha256sums=('0354e598dcbd3b7ac7f44e6c8b77699c5c7b51691b23e711513d785c3af06933')

build() {
  cd "${srcdir}/${_realname}-v${pkgver}/src"
  mingw32-make
}

package() {
  cd "${srcdir}/${_realname}-v${pkgver}/src"
  mkdir -p "${pkgdir}"/${MINGW_PREFIX}/bin/
  install -m 755 ../bin/mtn "${pkgdir}"/${MINGW_PREFIX}/bin/
  mkdir -p "${pkgdir}"/${MINGW_PREFIX}/share/man/man1
  cp -p ../man/mtn.1 "${pkgdir}"/${MINGW_PREFIX}/share/man/man1/
}
